Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: monitoring for endpoints #24470

Merged
merged 5 commits into from
Aug 20, 2024
Merged

Conversation

anirudhpillai
Copy link
Contributor

Problem

Don't have visibility on load to our endpoint. Can't detect spikes/falls in requests

Changes

Added monitoring to some endpoints for which we will want to have alerting setup.
Also setting the sentry tag for each of the requests so that we can categories errors/sentry issues according to the feature (have more context which parts of our stack are broken/cause users more issues)

Does this work well for both Cloud and self-hosted?

N/A

How did you test this code?

Tested the decorator is hit/doesn't error out locally

@anirudhpillai anirudhpillai requested a review from a team August 19, 2024 20:38
@@ -72,6 +69,11 @@ def clear_stale_cohort(cohort_id: int, before_version: int) -> None:
@shared_task(ignore_result=True, max_retries=2)
def calculate_cohort_ch(cohort_id: int, pending_version: int, initiating_user_id: Optional[int] = None) -> None:
cohort: Cohort = Cohort.objects.get(pk=cohort_id)

set_tag("feature", Feature.COHORT.value)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_tag call needs to be in the same thread (celery task) for sentry scoping to work

@anirudhpillai anirudhpillai merged commit 8c1d243 into master Aug 20, 2024
86 checks passed
@anirudhpillai anirudhpillai deleted the feat/monitoring-product-analytics branch August 20, 2024 13:37
Copy link

sentry-io bot commented Aug 20, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ IntegrityError: new row for relation "posthog_dashboardtile" violates check constraint "dash_tile_exactly_one_rel... /api/projects/{parent_lookup_project_id}/dashbo... View Issue
  • ‼️ IntegrityError: new row for relation "posthog_dashboardtile" violates check constraint "dash_tile_exactly_one_rel... /api/projects/{parent_lookup_project_id}/dashbo... View Issue
  • ‼️ CHQueryErrorTimeoutExceeded: DB::Exception: Timeout exceeded: elapsed 60.009491981 seconds, maximum: 60. Stack trace: /api/projects/{parent_lookup_project_id}/insigh... View Issue
  • ‼️ TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' /api/projects/{parent_lookup_project_id}/insights/ View Issue
  • ‼️ TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' /api/projects/{parent_lookup_project_id}/insigh... View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants